package DailyQuestions;


import java.util.Arrays;
import java.util.Scanner;

/*输出一个整数，表示所有队伍的水平值做大和*/
public class MaxLevel {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] ary=new int[3*n];
        for(int i=0;i<ary.length;i++){
            ary[i]=sc.nextInt();
        }
        maxLevel(ary,n);
    }

    public static void maxLevel(int[] ary,int n) {
        Arrays.sort(ary);//排序
        long max = 0;//记录最大水平和
        int cur = ary.length - 2;
        for (int i = 0; i < n; i++) {
            max += ary[cur];
            cur -= 2;
        }
        System.out.println(max);
    }
}